import org.omg.CORBA.PUBLIC_MEMBER;

import java.sql.Array;
import java.util.Arrays;

import static java.sql.Array.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-08-19
 * Time: 17:21
 */
public class Test1 {
    public static void main(String[] args) {
      /*  int a=78;
        Integer i=a;//自动装箱
        Integer ii=new Integer(a);//显示装箱
        Integer iii=Integer.valueOf(a);//显示装箱

        int j=i;//自动拆箱
        int jj=ii.intValue();//显示拆箱
        double jjj=iii.doubleValue();//显示拆箱
        System.out.println(a);*/

        Integer a = 127;
        Integer b = 127;
        Integer c = 128;
        Integer d = 128;
        System.out.println(a == b);
        System.out.println(c == d);
    }
}

class MyArray<T>{
    public Object[] objects=new Object[10];
    public  T getPos(int pos){
        return (T)this.objects[pos];
    }
    public void setVal(int pos,T val){
        this.objects[pos]=val;
    }
    public Object[] getArray(){
        return objects;
    }
}
class Test13{
    public static void main(String[] args) {
        MyArray<Integer> myArray1=new MyArray<>();
        myArray1.setVal(0,48);
    }
}


class ALg<T extends Comparable>{
    public T findMax(T[] array){
        T max=array[0];
        for (int i = 1; i <array.length; i++) {
            if(max.compareTo(array[i])<0){
                max=array[i];
            }
        }
        return max;
    }
}

class Test34{
    public static void main(String[] args) {
        ALg<Integer> alg=new ALg<>();
        Integer[] array={1,56,4,76,9};
        Integer max=alg.findMax(array);
        System.out.println(max);
    }
}


class ALg2{
    public static<T extends Comparable<T>>  T findMax(T[] array){
        T max=array[0];
        for (int i = 1; i <array.length; i++) {
            if(max.compareTo(array[i])<0){
                max=array[i];
            }
        }
        return max;
    }
}

class Test35{
    public static void main(String[] args) {
        SeqList seqList=new SeqList();
        seqList.add(1);
        seqList.add(2);
        seqList.add(3);
        seqList.add(4);
        seqList.add(5);
        seqList.display();
        System.out.println(seqList.contain(5));
        System.out.println(seqList.indexOf(3));
        System.out.println(seqList.indexOf(7));
/*        System.out.println(seqList.size());
        try{
            seqList.set(15,9);
        } catch (PosOutBoundsException e) {
            e.printStackTrace();
            System.out.println("我捕获到了一个异常");
        }*/
        seqList.display();
        seqList.add(4,890);
        seqList.display();
        seqList.remove(890);
        seqList.display();
    }
}


